package com.fjec.user.controller;

import com.fjec.user.service.ISysPermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 005.权限表 前端控制器
 * </p>
 *
 * @author admin
 * @since 2020-08-31
 */
@RestController
@RequestMapping("/")
public class SysPermissionController {

    @Autowired
    private ISysPermissionService sysPermissionServ;

    @Cacheable(value = "permissionCache", key = "#roleCode")
    @GetMapping("/n/permission/getPermsByRoleCode")
    public List<String> getPermsByRoleCode(@RequestParam("roleCode") String roleCode) {
        return sysPermissionServ.getPermsByRoleCode(roleCode);
    }
}
